<div id="sidebar">
<?php if (is_array($this->passwords[0])): ?>
	<ul class="catlisting">
	<?php foreach ($this->passwords[0] as $pswd): ?>
		<li><a href="<?= $this->url(array('uid' => $pswd['uid']), 'viewpass') ?>"><img src="/images/link_bullet.png" alt="->"> <?= $pswd['summary'] ?></a></li>
	<?php endforeach; ?>
	</ul>
<?php endif; ?>

<?php if (isset($this->categories) && count($this->categories) >= 1): ?>  	
 <?php foreach ($this->categories as $cat): ?>
  <p class="cat">
  	<?php if (isset($this->passwords) && !isset($this->passwords[$cat['uid']])): ?>
  	 <div class="deleteLink"><a href="<?= $this->url(array('action' => 'delete', 'uid' => $cat['uid']), 'categoryadmin') ?>" title="Delete"><img src="/images/delete.png"></a></div>
  	<?php else: ?>
  	 <div class="deleteLink"><a href="#" title="Delete (Disabled)"><img src="/images/bullet.png"></a></div>
  	<?php endif; ?>
  	<div class="category_name"><?= $cat['category'] ?> 
  	</div>
  	<?php if (is_array($this->passwords[$cat['uid']])): ?>
  	<ul class="catlisting">
		<?php foreach ($this->passwords[$cat['uid']] as $pswd): ?>
		 <li<?php if ($this->uid == $pswd['uid']) echo ' id="selected"' ?>><a href="<?= $this->url(array('uid' => $pswd['uid']), 'viewpass') ?>"><img src="/images/link_bullet.png" alt="->"> <?= $pswd['summary'] ?></a></li>
		<?php endforeach; ?>
  	</ul>
  	<?php endif; ?>
  </p>
 <?php endforeach; ?>
<?php endif; ?>
</div>